<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class Validateimage
{
	public function validate_image()
	{
	    $config['upload_path'] = './uploads/image/products/';
	    $config['allowed_types'] = 'gif|jpg|png';
	    $config['max_size']    = '100';
	    $config['max_width']  = '1024';
	    $config['max_height']  = '768';

	    $this->load->library('upload', $config);
	    
	    if (!$this->upload->do_upload('userfile'))
	    {
	        $this->validation->set_message('userfile',$this->upload->display_errors());
	        return false;
	    } else {
	        return true;
	    }
	}  
}	